package com.sharemarking.application.common.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.sharemarking.application.common.BaseEntity;

@Entity
@Table(name="sys_role")
public class Role extends BaseEntity {
	@Column(nullable=false)
	private String name;
	@Column(nullable=false,unique=true)
	private String ename;
	private Boolean usable;
	@OneToMany(mappedBy="role",cascade={CascadeType.ALL})
	private List<Permission> permissions;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getEname() {
		return ename;
	}
	public void setEname(String ename) {
		this.ename = ename;
	}
	public Boolean getUsable() {
		return usable;
	}
	public void setUsable(Boolean usable) {
		this.usable = usable;
	}
	public List<Permission> getPermissions() {
		return permissions;
	}
	public void setPermissions(List<Permission> permissions) {
		this.permissions = permissions;
	}
}
